package com.jilin.library.service;

import com.jilin.library.entity.Book;
import com.jilin.library.mapper.BookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class BookService {
    @Autowired
    private BookMapper bookMapper;
    
    public List<Book> findAll() {
        return bookMapper.findAll();
    }
    
    public Book addBook(Book book) {
        bookMapper.insert(book);
        return book;
    }
    
    public int updateStock(Integer id, Integer quantity) {
        return bookMapper.updateStock(id, quantity);
    }
} 